@extends('layouts.default')  
@section('content')
<div class="box primary">          
    <header>
        <h5></h5>
        <!-- .toolbar -->
        <div class="toolbar">
            <nav style="padding: 8px;">
                <a href="javascript:;" class="btn btn-default btn-xs collapse-box">
                    <i class="fa fa-minus"></i>
                </a> 
                <a href="javascript:;" class="btn btn-default btn-xs full-box">
                    <i class="fa fa-expand"></i>
                </a> 
                <a href="javascript:;" class="btn btn-danger btn-xs close-box">
                    <i class="fa fa-times"></i>
                </a> 
            </nav>
        </div><!-- /.toolbar -->
    </header>
    <div id="div-1" class="body">   
        @foreach ($values as $v) 
        {{ Form::model($v, array('route' => array(
                        'maintenance.update', $v->maint_id),
                'method' => 'PUT','class'=>'form-horizontal',
                'id'=>'form-validate')) 
        }}
        <div class="form-group">
            {{ Form::label('process', Lang::get('messages.process').'*', array(
                            'class'=>'control-label col-lg-4')) 
            }}
            <div class="col-lg-8">
                {{ Form::select('process', $processes, $v->process_id, array( 
                                'class' => 'form-control',
                                'placeholder' => Lang::get('messages.process'))) 
                }}             
            </div>
        </div>  
        <div class="form-group">
            {{ Form::label('description',Lang::get('messages.description'), array(
                            'class'=>'control-label col-lg-4')) 
            }}
            <div class="col-lg-8">
                {{ Form::textarea('description',isset($v->descr) ? $v->descr : '', array(
                                'class' => 'form-control',
                                'placeholder' => Lang::get('messages.write_description'))) 
                }}
                <br/>
            </div>
        </div>
        <div class="row form-group">
            {{ Form::label('price', Lang::get('messages.price').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-4">
                {{ Form::text('price', isset($v->price) ? $v->price : '', array( 
                                'class' => 'form-control',
                                'placeholder' => Lang::get('messages.price'))) 
                }}              
            </div>
            <div class="col-lg-4">
                {{ Form::select('currency', $currencies, isset($v->currency) ? $v->currency:'', array( 
                                'class' => 'form-control')) 
                }}                      
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('maintenance_date', Lang::get('messages.maintenance_date').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Helpers\Helper::date('maintenance_date', isset($v->maintenance_date) ? $v->maintenance_date : '', array(
                                'class' => 'form-control',
                            )) 
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('km_due', Lang::get('messages.km_due'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::text('km_due', isset($v->km_due) ? $v->km_due : '', array( 
                                'class' => 'form-control')) 
                }}              
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('month_due', Lang::get('messages.month_due'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::text('month_due', isset($v->month_due) ? $v->month_due : '', array( 
                                'class' => 'form-control')) 
                }}              
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('service', Lang::get('messages.service').'*', array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::select('service', $services, $v->service_id, array( 
                                'class' => 'form-control')) 
                }}             
            </div>
        </div>    
        <div class="form-group">
            {{ Form::label('nr_invoice', Lang::get('messages.nr_invoice'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::text('nr_invoice',isset($v->nr_invoice) ? $v->nr_invoice : '' , array( 
                                'class' => 'form-control',
                                'placeholder'=>Lang::get('messages.nr_invoice'))) 
                }}              
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('type', Lang::get('messages.type_maintenance').'*',array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::select('type', array(
                                'Inspection' => Lang::get('messages.inspection'), 
                                'Maintenance' => Lang::get('messages.maintenance')),
                        isset($v->type) ? $v->type : '', array(
                                'class' => 'form-control',
                                ))
                }}
            </div>
        </div>
        <div class="form-group">
            {{ Form::label('comment',Lang::get('messages.comment'), array(
                            'class'=>'control-label col-lg-4')) }}
            <div class="col-lg-8">
                {{ Form::textarea('comment', isset($v->comment) ? $v->comment : '', array(
                                'class' => 'form-control',
                                'placeholder'=>Lang::get('messages.write_comment'))) }}
                <br/>
                <div id="validation-div" class="">
                </div>
            </div>
        </div>
        {{ Form::submit(Lang::get('messages.save_btn'), array('class' => 'btn btn-primary btn-line')) }}
        <input type="button" value="{{Lang::get('messages.cancel_btn')}}" class="btn btn-danger btn-line" 
               onClick="history.go(-1);
                       return true;">
        {{ Form::close() }}
        @endforeach
    </div>
</div>  
@stop
